var eventObjs={

}
var on = function(dom,eventName,cb){
    var event = new Event(eventName,{bubbles:true});
    if(eventObjs.hasOwnProperty(eventName)){
        return;
    }
    eventObjs[eventName]={
        e:event,
        cb:cb
    };
    dom.addEventListener(eventName,cb,false);
}


var off = function(dom,eventName){
    if(!eventObjs.hasOwnProperty(eventName)){
        return;
    }
    dom.removeEventListener(eventName,eventObjs[eventName].cb);
    delete eventObjs[eventName];
}

var trigger = function(dom,eventName){
    if(!eventObjs.hasOwnProperty(eventName)){
        return;
    }
    dom.dispatchEvent(eventObjs[eventName].e);
}

